#include"exes.h"

exes::exes()
{
	cnt++;
	x = 0;
	y = 0;
	name = '\0';
	cout << "using normal constructor:" << cnt << endl;
}

exes::exes(int a, int b, string n)
{
	cnt++;
	x = a;
	y = b;
	name = n;
	cout << "using normal constructor:" << cnt << endl;
}

exes::exes(const exes& a)
{
	cnt++;
	x = a.x;
	y = a.y;
	name = a.name;
	cout << "using copy constructor:" << cnt << endl;
}

exes::~exes()
{
	cnt--;
	cout << "using deconstructor:" << cnt << endl;
}

void exes::show()
{
	cout << "x=" << x << " ";
	cout << "y=" << y << " ";
	cout << "name=" << name << " " << endl;
}

void exes::init()
{
	cin >> x;
	cin >> y;
	cin >> name;
}

int exes::cnt = 0;

void ExesTest01()
{
	exes E1(2, 3, "zhangsan");
	exes E2 = E1;
	E2.show();

	exes E3;
	E3.init();
	E3.show();
}

int main()
{
	ExesTest01();

	return 0;
}